FROM jenkins/jenkins:lts
USER root
WORKDIR /dotnet
RUN  apt-get update \
  && apt-get install -y wget icu-devtools vim zip unzip \
  && rm -rf /var/lib/apt/lists/*
RUN wget -O dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/820db713-c9a5-466e-b72a-16f2f5ed00e2/628aa2a75f6aa270e77f4a83b3742fb8/dotnet-sdk-5.0.100-linux-x64.tar.gz
RUN tar zxf dotnet.tar.gz -C ./
RUN rm -rf dotnet.tar.gz
ENV PATH="${PATH}:/dotnet:/var/jenkins_home/.dotnet/tools"
ENV DOTNET_ROOT="/dotnet"
RUN usermod -a -G root jenkins
USER jenkins